namespace Front._1117;

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }
    private void button1_Click(object sender, EventArgs e)
    {
        OpenFileDialog ofd = new OpenFileDialog();
        if (ofd.ShowDialog() == DialogResult.OK)
        {
            //执行头像上传
            //获取文件名
            string fileName = ofd.FileName;
            File.Copy(fileName,destFileName:"D:\\1117\\" + Path.GetFileName(fileName));
        }
    }

    private void button2_Click(object sender, EventArgs e)
    {
        string word = "hello world";
        SaveFileDialog sfd = new SaveFileDialog();
        if (sfd.ShowDialog() == DialogResult.OK)
        {
            string path = sfd.FileName;
            File.WriteAllText(path,word);
        }
    }
}